﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using Phoenix.AppCode.Entities;
using System.Data.SqlClient;

namespace Phoenix.AppCode.Data
{
    public class CounterDAO : BaseDAO
    {
        public DataTable GetCounter(Counter counter)
        {
            using (SqlConnection connection = GetConnection())
            {
                connection.Open();
                SqlCommand command = new SqlCommand("sp_CounterList", connection);
                command.CommandType = CommandType.StoredProcedure;
                SqlDataAdapter sda = new SqlDataAdapter(command);
                DataTable dt = new DataTable();
                sda.Fill(dt);
                command.ExecuteNonQuery();
                return dt;
            }
        }
        public void Update(Counter counter)
        {
            using (SqlConnection connection = GetConnection())
            {
                SqlCommand command = new SqlCommand("sp_CounterUpdate", connection);
                command.CommandType = CommandType.StoredProcedure;
                connection.Open();
                command.ExecuteNonQuery();
            }
        }
    }
}